<!DOCTYPE html>
<html lang="en">

<head>
  <base href="{{ baseHref }}">
  <meta charset="utf-8">
  <title>{% block title %}Index{% endblock %} - Mongo Express</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <link href="{{ baseHref }}public/css/style.css" rel="stylesheet" />

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">

  <link rel="prefetch" href="{{ baseHref }}public/img/gears.gif">

  {% block styles %}{% endblock %}
</head>

<body class="pb-3">

  <nav class="navbar navbar-expand-lg navbar-light bg-light sticky-top p-0">
  <div class="{% if settings.fullwidth_layout %}container-fluid{% else %}container{% endif %}">
      <a class="navbar-brand" href="{{ baseHref }}">
        <img src="{{ baseHref }}public/img/mongo-express-logo.png" width="30" height="30" class="d-inline-block align-top" alt="" />
        Mongo Express
      </a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
        aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
          {% block breadcrumb %}
          {% endblock %}
        </ul>
      </div>
  </div>
</nav>


<div class="{% if settings.fullwidth_layout %}container-fluid{% else %}container{% endif %}">
  <div>
    <h1 id="pageTitle" class="pb-2 border-bottom border-dark">{{ title }}</h1>

    {% if messageSuccess %}
    <div class="alert alert-success" role="alert">
      <strong>{{ messageSuccess }}</strong>
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
        <span aria-hidden="true">&times;</span>
      </button>
    </div>
    {% endif %}

    {% if messageError %}
    <div class="alert alert-danger" role="alert">
      <strong>{{ messageError }}</strong>
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
        <span aria-hidden="true">&times;</span>
      </button>
    </div>
    {% endif %}

  </div>

  <div>
    {% block content %}
    {% endblock %}
  </div>
</div>

<script src="{{ baseHref }}{{assets.vendor.js}}"></script>
<script type="text/javascript">

window.ME_SETTINGS = {
  readOnly: '{{ !!settings.read_only }}' === 'true',
  noDelete: '{{ !!settings.no_delete }}' === 'true',
  baseHref: '{{ baseHref }}',
  collapsibleJSON: '{{ !!settings.me_collapsible_json }}' === 'true',
  collapsibleJSONDefaultUnfold: Number.parseInt('{{ settings.me_collapsible_json_default_unfold || 0}}', 10),
  confirmDelete: '{{ !!settings.me_confirm_delete }}' === 'true',
  dbName: '{{ dbName | url_encode }}',
  collectionName: '{{ collectionName | url_encode }}',
  bucketName: '{{ bucketName }}',
  limit: '{{ limit }}',
  skip: '{{ skip }}',
  totalPages: Math.ceil('{{ count }}' / '{{ limit }}')
};
</script>
{% block scripts %}
{% endblock %}
</body>
</html>
